using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;

namespace OrderSample.Controllers
{

    [TraceFilter(Order = 2, Message = "CONTROLLER - MyDerivedController")]
    [TraceFilter(Order = 1, Message = "CONTROLLER - MyDerivedController")]
    public class MyDerivedController : MyBaseController
    {
        [TraceFilter(Order = 1, Message = "ACTION - MyDerivedController.Index")]
        [TraceFilter(Order = 2, Message = "ACTION - MyDerivedController.Index")]
        public override ActionResult Index()
        {
            HttpContext.Trace.Write(
                "Trace Filter",
                String.Format("MyDerivedController.Index ACTION")
                );
            return View("FilterTracing");
        }

        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            filterContext.HttpContext.Trace.Write(
                "Trace Filter",
                String.Format("MyDerivedController.OnActionExecuting: VIRTUAL METHOD")
                );
        }

        protected override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            filterContext.HttpContext.Trace.Write(
                "Trace Filter",
                String.Format("MyDerivedController.OnActionExecuted: VIRTUAL METHOD")
                );
        }
    }
}
